<template>
  <div class="home">
  <home-header class="home-he" :city="city"></home-header>
  <home-swiper class="home-sw" :headerImg="headerImg"></home-swiper>
  <home-catalog :iconlist="iconlist"></home-catalog>
  <home-hot :hotRightlits="hotRightlits" :leftPriselits="leftPriselits" :leftContentlits="leftContentlits"></home-hot>
  <home-weekend :weekendSWIPR="weekendSWIPR"></home-weekend>
  <home-guess :Guesslist="Guesslist"></home-guess>
  <hoem-daohl></hoem-daohl>
  </div>
</template>

<script>
//	引入组件
	import homeHeader from './components/homeHeader.vue'
		import homeSwiper from './components/homeSwiper.vue'
		import homeCatalog from './components/homeCatalog.vue'
		import homeHot from './components/homeHot.vue'
		import homeWeekend from './components/homeWeekend.vue'
		import homeGuess from './components/homeGuess.vue'
		import hoemDaohl from './components/hoemDaohl.vue'
		import axios from 'axios'
//	定义输出组件name
export default {
  name: 'Home',
//注册组件
  components:{
  	homeHeader,
  	homeSwiper,
  	homeCatalog,
	  homeHot,
	  homeWeekend,
	  homeGuess,
	  hoemDaohl
  } ,
  data(){
	  return{
		  city:'',
		Guesslist:[],
		headerImg:[],
		hotRightlits:[],
		leftPriselits:[],
		leftContentlits:[],
		weekendSWIPR:[],
		iconlist:[]

	  }
  },
  methods:{
    getHomeData(){
		axios.get("/api/index.json")
		     .then(this.getHomeDataSucc)
	},
    getHomeDataSucc(res){
	//   console.log(res)
	     res = res.data
	 if(res.data){
		const data = res.data
		this.city = data.city
		this.Guesslist = data.Guesslist
		 this.headerImg =data.headerImg
		 this.hotRightlits=data.hotRightlits
		 this.leftPriselits=data.leftPriselits
		 this.leftContentlits=data.leftContentlits
		 this.weekendSWIPR=data.weekendSWIPR
		 this.iconlist=data.iconlist






	 }
	}
  },
  mounted(){
	  this.getHomeData()
  }
}
</script>


<style scoped>

	.home{
		position: relative;
	
	}
	.home-he{
		position: absolute;
		left: 0px;top: 0px;
	z-index: 200;
		width: 100%;
	}
	

</style>
